package org.aceor.mddal.common.sqlparser.result.context;

import com.google.common.base.Objects;
import com.google.common.collect.Lists;
import org.aceor.mddal.common.sqlparser.result.object.AggregationColumn;
import org.aceor.mddal.common.sqlparser.result.object.GroupByColumn;
import org.aceor.mddal.common.sqlparser.result.object.Limit;
import org.aceor.mddal.common.sqlparser.result.object.OrderByColumn;

import java.util.List;

/**
 * Created by lxue on 16/3/23.
 */
public class MergeContext {
    private final List<OrderByColumn> orderByColumns = Lists.newArrayList();

    private final List<GroupByColumn> groupByColumns = Lists.newArrayList();

    private final List<AggregationColumn> aggregationColumns = Lists.newArrayList();

    private Limit limit;

    public List<OrderByColumn> getOrderByColumns() {
        return orderByColumns;
    }

    public List<GroupByColumn> getGroupByColumns() {
        return groupByColumns;
    }

    public List<AggregationColumn> getAggregationColumns() {
        return aggregationColumns;
    }

    public Limit getLimit() {
        return limit;
    }

    public void setLimit(Limit limit) {
        this.limit = limit;
    }

    @Override
    public String toString() {
        return Objects.toStringHelper(this)
                .add("OrderbyColumns", orderByColumns)
                .add("GroupbyColumns", groupByColumns)
                .add("AggregationColumns", aggregationColumns)
                .toString();
    }
}
